package com.rd.student.wulian.wanggaobo.day0803;

import java.util.ArrayList;
import java.util.Random;

public class PetStore extends Animal {
    public PetStore(String name) {
        super(name);
    }

    public static void main(String[] args) {
        ArrayList<Animal> petShop = new ArrayList();
        String ladyName = "王女士,张女士";
        String[] ladyNameArr = ladyName.split(",");
        for (int i = 0; i < 10; i++) {
            Dog dog = new Dog("狗" + (i + 1), "黄色");
            petShop.add(dog);
        }

        for (int i = 0; i < 5; i++) {
            Cat cat = new Cat("猫" + (i + 1), "白色");
            petShop.add(cat);
        }

        for (int i = 0; i < 3; i++) {
            Pig pig = new Pig("猪" + (i + 1));
            petShop.add(pig);
        }
        for (int i = 0; i < ladyNameArr.length; i++) {

            Random random = new Random();
            int index = random.nextInt(18);

            System.out.println("选中了第 " + (index + 1) + " 只宠物");
            Animal pet = petShop.get(index);
            Lady lady = new Lady(ladyNameArr[i], pet);
            lady.myPetEnjoy();
        }


    }

    @Override
    public void enjoy() {

    }

    @Override
    public void voice() {

    }
}